package com.mrper.util;

import android.app.Dialog;

/**
 * Created by admin on 2016/3/15.
 */
public class DialogUtil {

    /**
     * 显示对话框
     * @param dialog 对话框对象
     */
    public static void showDialog(Dialog dialog){
        if(dialog!=null && !dialog.isShowing())
            dialog.show();
    }

    /**
     * 隐藏dialog
     * @param dialog 对话框对象
     * @param isCancel 是否取消对话框对象
     */
    public static void hideDialog(Dialog dialog,boolean isCancel){
        if(dialog!=null && dialog.isShowing()) {
            dialog.dismiss();
            if(isCancel)
                dialog.cancel();
        }
    }

}
